//% color="#CD853F" iconWidth=50 iconHeight=40
namespace EOxygenSensor{

    //% block="DFRobot_EOxygenSensorInit ADDRESS [ADDRESS]  " blockType="command" 
    //% ADDRESS.shadow="dropdown" ADDRESS.options="ADDRESS"
    
    export function EOxygenSensorInit(parameter: any, block: any) {
         let addr = parameter.ADDRESS.code;
 
     

        Generator.addInclude("EOxygenSensorInit", "#include <DFRobot_EOxygenSensor.h>");
        
        Generator.addObject("EOxygenSensorInit","DFRobot_EOxygenSensor_I2C ",`oxygen(&Wire, ${addr});`);
  
        Generator.addCode(`while(!oxygen.begin());`);
    
        
    }
 
    //% block="DFRobot_EOxygenSensorInit  data " blockType="reporter" 
 
    export function EOxygenSensorInitGet(parameter: any, block: any) { 
  
        Generator.addCode( [`oxygen.readOxygenConcentration()`,Generator.ORDER_UNARY_POSTFIX]);
   
   }
 
   
}